﻿/*Copyright (C) 2010-2012 RAAFCOM B.V. All rights reserved.

This file is part of Velsto and may be used under the terms of:
The GNU General Public License version 3 or higher, as published by
the Free Software Foundation.

This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.*/
/*
* Application  : Velsto
* Class        : SimulationEntity
* 04/06/2010-  : M.A.van Ravesteijn (Raafcom)
*   02/12/2011   Initial version v1.0
* 03/05/2012   : M.A. van Ravesteijn (Raafcom) v1.1  
* 
* Class for Simulation Entity to maintain Simulation parameters during Dialog
*/ 

using System;
using System.Collections.Generic;
using System.Collections;
using System.Linq;
using System.Text;

namespace Velsto
{
    public class SimulationEntity
    {
        private string version = "3.0";
        private string vswFilename = "";
        private bool newFile = false;
        private bool savedFile = true;
        private string projectName = "NewProject";
        private int simulOption = 1;
        private int simulNr = 500;
        private int nrLayers = 2;
        private int nrPoints = 1;
        private int topLayerXtrap = 0;
        private string inputFileTWT = "";
        private string resultFolderpath = "";
        private string tempFolderpath = "";
        private string joinInputFile = "";
        private bool gridsJoined = false;
        private int gridsCondOption = 1;
        private string joinSingleFile = "";
        private XYPointEntity singleSearch = new XYPointEntity();
        private XYPointEntity singleFound = new XYPointEntity();
        private bool singleSelected = false;
        private int nrJoinedGrids = 0;
        private string runVelsimFile = "";
        private ArrayList alInputFileTWT;
        private ArrayList alInputFileV0;
        private ArrayList alInputFileF;
        private ArrayList alInputFileVVNdev;
        private ArrayList alInputFileTWTdev;
        private ArrayList alLayername;
        private bool gridTWTdevinseconds = false;
        private ArrayList alLayerParams;
        private string repFile = "";
        private string avzFile = "";
        private string sdzFile = "";
        private string mapFile = "";
        private string mapXyzFile = "";
        private int mapNcols = 0;
        private int mapNrows = 0;
        private double mapXllcenter = 0.0;
        private double mapYllcenter = 0.0;
        private double mapCellsize = 0.0;
        private int mapType = 1;
        private int mapLayernr = 1;
        private int mapSimLayernr = 1;
        private int mapALayernr = 1;
        private int mapBLayernr = 1;
        private int mapASaveLayernr = 1;
        private int mapBSaveLayernr = 1;
        private bool mapAReady = false;
        private bool mapBReady = false;
        private Dictionary<XYPointEntity,double> mapSl = new Dictionary<XYPointEntity,double>();
        private double gridXMin = 0.0;
        private double gridXMax = 0.0;
        private double gridYMin = 0.0;
        private double gridYMax = 0.0;
        private double gridVMin = 0.0;
        private double gridVMax = 0.0;
        private double gridVMean = 0.0;
        private double gridInterval = 0.0;
        private int griddingType = 0;
        private string griddingInFile = "";
        private string griddingOutFile = "";
        private double griddingSearchRadius = 0.0;
        private string runGmtFile = "";
        private string gmtLog_gr = "";
        private string gmtLog_gc = "";
        private string gc_File1 = "";
        private string gc_File2 = "";
        private string gc_FileOut = "";
        private int gc_Operator = 0;
        private bool gc_GridGrid = false;
        private double gc_Constant = 0.0;
        private string singleRepFile = "";
        private string singleAvzFile = "";
        private string singleSdzFile = "";
        private string wellLayerFile = "";
        private string wellTvdMarkerFile = "";
        private string wellResidualFile = "";
        private double wellResVarioC0 = 0.0;
        private double wellResVarioC1 = 0.0;
        private double wellResVarioRange = 0.0;
        private int wellResVarioModel = 0;
        private int wellResKrigingType = 0;
        private string kb2dControlPointsFile = "";
        private double kb2dRange = 0.0;
        private string kb2dOutputFile = "";
        private string kb2dParFile = "";
        private bool kb2dGo = false;
        private int nrWellLayers = 0;
        private string shpfilename_open = "";
        private string shpfilename_mar = "";
        private int rwf_phase = 0;
        private int file_rwf_phase = 0;
        private double res_mean = 0.0;
        private double res_stdev = 0.0;
        private string errorMessage = "";

        public SimulationEntity()
        {
            inputFileTWT = "";
            alInputFileTWT = new ArrayList();
            alInputFileV0 = new ArrayList();
            alInputFileF = new ArrayList();
            alInputFileVVNdev = new ArrayList();
            alInputFileTWTdev = new ArrayList();
            alLayername = new ArrayList();
            alLayerParams = new ArrayList();
            for (int i=0; i<10; i++)
            {
                alInputFileTWT.Add("");
                alInputFileV0.Add("");
                alInputFileF.Add("");
                alInputFileVVNdev.Add("");
                alInputFileTWTdev.Add("");
                alLayername.Add("");
                LayerparamsEntity lp = new LayerparamsEntity();
                alLayerParams.Add(lp);
            }
        }

        public SimulationEntity(SimulationEntity se2)
        {
            version = se2.Version;
            vswFilename = se2.VswFilename;
            newFile = se2.NewFile;
            savedFile = se2.SavedFile;
            projectName = se2.ProjectName;
            simulOption = se2.SimulOption;
            simulNr = se2.SimulNr;
            nrLayers = se2.NrLayers;
            nrPoints = se2.NrPoints;
            topLayerXtrap = se2.TopLayerXtrap;
            resultFolderpath = se2.ResultFolderpath;
            tempFolderpath = se2.TempFolderpath;
            inputFileTWT = se2.InputFileTWT;
            joinInputFile = se2.JoinInputFile;
            gridsJoined = se2.GridsJoined;
            gridsCondOption = se2.gridsCondOption;
            joinSingleFile = se2.JoinSingleFile;
            singleSearch = se2.SingleSearch;
            singleFound = se2.SingleFound;
            singleSelected = se2.SingleSelected;
            nrJoinedGrids = se2.NrJoinedGrids;
            runVelsimFile = se2.RunVelsimFile;
            alInputFileTWT = se2.AlInputFileTWT;
            alInputFileV0 = se2.AlInputFileV0;
            alInputFileF = se2.AlInputFileF;
            alInputFileVVNdev = se2.AlInputFileVVNdev;
            alInputFileTWTdev = se2.AlInputFileTWTdev;
            alLayername = se2.AlLayername;
            gridTWTdevinseconds = se2.GridTWTdevinseconds;
            alLayerParams = se2.AlLayerParams;
            repFile = se2.RepFile;
            avzFile = se2.AvzFile;
            repFile = se2.RepFile;
            mapFile = se2.MapFile;
            mapXyzFile = se2.mapXyzFile;
            mapNcols = se2.MapNcols;
            mapNrows = se2.MapNrows;
            mapXllcenter = se2.MapXllcenter;
            mapYllcenter = se2.MapYllcenter;
            mapCellsize = se2.MapCellsize;
            mapType = se2.MapType;
            mapLayernr = se2.MapLayernr;
            mapSimLayernr = se2.MapSimLayernr;
            mapALayernr = se2.MapALayernr;
            mapBLayernr = se2.MapBLayernr;
            mapASaveLayernr = se2.MapASaveLayernr;
            mapBSaveLayernr = se2.MapBSaveLayernr;
            mapAReady = se2.MapAReady;
            mapBReady = se2.MapBReady;
            mapSl = se2.MapSl;
            gridXMin = se2.GridXMin;
            gridXMax = se2.GridXMax;
            gridYMin = se2.GridYMin;
            gridYMax = se2.GridYMax;
            gridVMin = se2.GridVMin;
            gridVMax = se2.GridVMax;
            gridVMean = se2.GridVMean;
            gridInterval = se2.GridInterval;
            griddingType = se2.GriddingType;
            griddingSearchRadius = se2.GriddingSearchRadius;
            griddingInFile = se2.GriddingInFile;
            griddingOutFile = se2.GriddingOutFile;
            runGmtFile = se2.RunGmtFile;
            gmtLog_gr = se2.GmtLog_gr;
            gmtLog_gc = se2.GmtLog_gc;
            gc_File1 = se2.Gc_File1;
            gc_File2 = se2.Gc_File2;
            gc_FileOut = se2.Gc_FileOut;
            gc_Constant = se2.Gc_Constant;
            gc_GridGrid = se2.Gc_GridGrid;
            gc_Operator = se2.Gc_Operator;
            singleRepFile = se2.SingleRepFile;
            singleAvzFile = se2.SingleAvzFile;
            singleSdzFile = se2.SingleSdzFile;
            wellLayerFile = se2.WellLayerFile;
            wellTvdMarkerFile = se2.WellTvdMarkerFile;
            wellResidualFile = se2.WellResidualFile;
            wellResVarioC0 = se2.WellResVarioC0;
            wellResVarioC1 = se2.WellResVarioC1;
            wellResVarioRange = se2.WellResVarioRange;
            wellResVarioModel = se2.WellResVarioModel;
            wellResKrigingType = se2.WellResKrigingType;
            nrWellLayers = se2.NrWellLayers;
            kb2dRange = se2.Kb2dRange;
            kb2dControlPointsFile = se2.Kb2dControlPointsFile;
            kb2dGo = se2.Kb2dGo;
            kb2dOutputFile = se2.Kb2dOutputFile;
            kb2dParFile = se2.Kb2dParFile;
            shpfilename_open = se2.Shpfilename_open;
            shpfilename_mar = se2.Shpfilename_mar;
            rwf_phase = se2.Rwf_phase;
            file_rwf_phase = se2.File_rwf_phase;
            res_mean = se2.Res_mean;
            res_stdev = se2.Res_stdev;
            errorMessage = se2.ErrorMessage;
        }


        public string Version
        {
            get { return version; }
            set { version = value; }
        }

        public string VswFilename
        {
            get { return vswFilename; }
            set { vswFilename = value; }
        }

        public string ResultFolderpath
        {
            get { return resultFolderpath; }
            set { resultFolderpath = value; }
        }


        public string TempFolderpath
        {
            get { return tempFolderpath; }
            set { tempFolderpath = value; }
        }

        public bool NewFile
        {
            get { return newFile; }
            set { newFile = value; }
        }

        public bool SavedFile
        {
            get { return savedFile; }
            set { savedFile = value; }
        }

        public string ProjectName
        {
            get { return projectName; }
            set { projectName = value; }
        }

        public int SimulOption
        {
            get { return simulOption; }
            set { simulOption = value; }
        }

        public int SimulNr
        {
            get { return simulNr; }
            set { simulNr = value; }
        }

        public int NrLayers
        {
            get { return nrLayers; }
            set { nrLayers = value; }
        }

        public int NrPoints
        {
            get { return nrPoints; }
            set { nrPoints = value; }
        }

        public int TopLayerXtrap
        {
            get { return topLayerXtrap; }
            set { topLayerXtrap = value; }
        }

        public string InputFileTWT
        {
            get { return inputFileTWT; }
            set { inputFileTWT = value; }
        }

        public string JoinInputFile
        {
            get { return joinInputFile; }
            set { joinInputFile = value; }
        }

        public bool GridsJoined
        {
            get { return gridsJoined; }
            set { gridsJoined = value; }
        }

        public int GridsCondOption
        {
            get { return gridsCondOption; }
            set { gridsCondOption = value; }
        }

        public string JoinSingleFile
        {
            get { return joinSingleFile; }
            set { joinSingleFile = value; }
        }

        public XYPointEntity SingleSearch
        {
            get { return singleSearch; }
            set { singleSearch = value; }
        }

        public XYPointEntity SingleFound
        {
            get { return singleFound; }
            set { singleFound = value; }
        }

        public bool SingleSelected
        {
            get { return singleSelected; }
            set { singleSelected = value; }
        }

        public int NrJoinedGrids
        {
            get { return nrJoinedGrids; }
            set { nrJoinedGrids = value; }
        }

        public string RunVelsimFile
        {
            get { return runVelsimFile; }
            set { runVelsimFile = value; }
        }

        public ArrayList AlInputFileTWT
        {
            get { return alInputFileTWT; }
            set { alInputFileTWT = new ArrayList(value); }
        }

        public ArrayList AlInputFileV0
        {
            get { return alInputFileV0; }
            set { alInputFileV0 = new ArrayList(value); }
        }

        public ArrayList AlInputFileF
        {
            get { return alInputFileF; }
            set { alInputFileF = new ArrayList(value); }
        }

        public ArrayList AlInputFileVVNdev
        {
            get { return alInputFileVVNdev; }
            set { alInputFileVVNdev = new ArrayList(value); }
        }

        public ArrayList AlInputFileTWTdev
        {
            get { return alInputFileTWTdev; }
            set { alInputFileTWTdev = new ArrayList(value); }
        }

        public ArrayList AlLayername
        {
            get { return alLayername; }
            set { alLayername = new ArrayList(value); }
        }

        public bool GridTWTdevinseconds
        {
            get { return gridTWTdevinseconds; }
            set { gridTWTdevinseconds = value; }
        }

        public ArrayList AlLayerParams
        {
            get { return alLayerParams; }
            set { alLayerParams = new ArrayList(value); }
        }

        public string RepFile
        {
            get { return repFile; }
            set { repFile = value; }
        }

        public string AvzFile
        {
            get { return avzFile; }
            set { avzFile = value; }
        }

        public string SdzFile
        {
            get { return sdzFile; }
            set { sdzFile = value; }
        }
        
        public string MapFile
        {
            get { return mapFile; }
            set { mapFile = value; }
        }

        public string MapXyzFile
        {
            get { return mapXyzFile; }
            set { mapXyzFile = value; }
        }

        public int MapNcols
        {
            get { return mapNcols; }
            set { mapNcols = value; }
        }

        public int MapNrows
        {
            get { return mapNrows; }
            set { mapNrows = value; }
        }

        public double MapXllcenter
        {
            get { return mapXllcenter; }
            set { mapXllcenter = value; }
        }

        public double MapYllcenter
        {
            get { return mapYllcenter; }
            set { mapYllcenter = value; }
        }

        public double MapCellsize
        {
            get { return mapCellsize; }
            set { mapCellsize = value; }
        }

        public int MapType
        {
            get { return mapType; }
            set { mapType = value; }
        }
        
        public int MapLayernr
        {
            get { return mapLayernr; }
            set { mapLayernr = value; }
        }

        public int MapSimLayernr
        {
            get { return mapSimLayernr; }
            set { mapSimLayernr = value; }
        }


        public int MapALayernr
        {
            get { return mapALayernr; }
            set { mapALayernr = value; }
        }

        public int MapBLayernr
        {
            get { return mapBLayernr; }
            set { mapBLayernr = value; }
        }

        public int MapASaveLayernr
        {
            get { return mapASaveLayernr; }
            set { mapASaveLayernr = value; }
        }

        public int MapBSaveLayernr
        {
            get { return mapBSaveLayernr; }
            set { mapBSaveLayernr = value; }
        }

        public bool MapAReady
        {
            get { return mapAReady; }
            set { mapAReady = value; }
        }

        public bool MapBReady
        {
            get { return mapBReady; }
            set { mapBReady = value; }
        }

        public Dictionary<XYPointEntity, double> MapSl
        {
            get { return mapSl; }
            set { mapSl = value; }
        }

        public double GridXMin
        {
            get { return gridXMin; }
            set { gridXMin = value; }
        }

        public double GridXMax
        {
            get { return gridXMax; }
            set { gridXMax = value; }
        }

        public double GridYMin
        {
            get { return gridYMin; }
            set { gridYMin = value; }
        }

        public double GridYMax
        {
            get { return gridYMax; }
            set { gridYMax = value; }
        }

        public double GridVMin
        {
            get { return gridVMin; }
            set { gridVMin = value; }
        }

        public double GridVMax
        {
            get { return gridVMax; }
            set { gridVMax = value; }
        }

        public double GridVMean
        {
            get { return gridVMean; }
            set { gridVMean = value; }
        }

        public double GridInterval
        {
            get { return gridInterval; }
            set { gridInterval = value; }
        }

        public int GriddingType
        {
            get { return griddingType; }
            set { griddingType = value; }
        }

        public double GriddingSearchRadius
        {
            get { return griddingSearchRadius; }
            set { griddingSearchRadius = value; }
        }

        public string GriddingInFile
        {
            get { return griddingInFile; }
            set { griddingInFile = value; }
        }

        public string GriddingOutFile
        {
            get { return griddingOutFile; }
            set { griddingOutFile = value; }
        }

        public string RunGmtFile
        {
            get { return runGmtFile; }
            set { runGmtFile = value; }
        }

        public string GmtLog_gr
        {
            get { return gmtLog_gr; }
            set { gmtLog_gr = value; }
        }

        public string GmtLog_gc
        {
            get { return gmtLog_gc; }
            set { gmtLog_gc = value; }
        }

        public string Gc_File1
        {
            get { return gc_File1; }
            set { gc_File1 = value; }
        }

        public string Gc_File2
        {
            get { return gc_File2; }
            set { gc_File2 = value; }
        }

        public string Gc_FileOut
        {
            get { return gc_FileOut; }
            set { gc_FileOut = value; }
        }

        public double Gc_Constant
        {
            get { return gc_Constant; }
            set { gc_Constant = value; }
        }

        public int Gc_Operator
        {
            get { return gc_Operator; }
            set { gc_Operator = value; }
        }

        public bool Gc_GridGrid
        {
            get { return gc_GridGrid; }
            set { gc_GridGrid = value; }
        }
            



        public string SingleRepFile
        {
            get { return singleRepFile; }
            set { singleRepFile = value; }
        }

        public string SingleAvzFile
        {
            get { return singleAvzFile; }
            set { singleAvzFile = value; }
        }

        public string SingleSdzFile
        {
            get { return singleSdzFile; }
            set { singleSdzFile = value; }
        }

        public string WellLayerFile
        {
            get { return wellLayerFile; }
            set { wellLayerFile = value; }
        }
        
        public string WellTvdMarkerFile
        {
            get { return wellTvdMarkerFile; }
            set { wellTvdMarkerFile = value; }
        }

        public string WellResidualFile
        {
            get { return wellResidualFile; }
            set { wellResidualFile = value; }
        }

        public double WellResVarioC0
        {
            get { return wellResVarioC0; }
            set { wellResVarioC0 = value; }
        }

        public double WellResVarioC1
        {
            get { return wellResVarioC1; }
            set { wellResVarioC1 = value; }
        }

        public double WellResVarioRange
        {
            get { return wellResVarioRange; }
            set { wellResVarioRange = value; }
        }

        public int WellResVarioModel
        {
            get { return wellResVarioModel; }
            set { wellResVarioModel = value; }
        }

        public int WellResKrigingType
        {
            get { return wellResKrigingType; }
            set { wellResKrigingType = value; }
        }

        public string Kb2dControlPointsFile
        {
            get { return kb2dControlPointsFile; }
            set { kb2dControlPointsFile = value; }
        }

        public string Kb2dOutputFile
        {
            get { return kb2dOutputFile; }
            set { kb2dOutputFile = value; }
        }

        public string Kb2dParFile
        {
            get { return kb2dParFile; }
            set { kb2dParFile = value; }
        }

        public double Kb2dRange
        {
            get { return kb2dRange; }
            set { kb2dRange = value; }
        }

        public bool Kb2dGo
        {
            get { return kb2dGo; }
            set { kb2dGo = value; }
        }

        public int NrWellLayers
        {
            get { return nrWellLayers; }
            set { nrWellLayers = value; }
        }

        public string Shpfilename_open
        {
            get { return shpfilename_open; }
            set { shpfilename_open = value; }
        }

        public string Shpfilename_mar
        {
            get { return shpfilename_mar; }
            set { shpfilename_mar = value; }
        }

        public int Rwf_phase
        {
            get { return rwf_phase; }
            set { rwf_phase = value; }
        }

        public int File_rwf_phase
        {
            get { return file_rwf_phase; }
            set { file_rwf_phase = value; }
        }

        public double Res_mean
        {
            get { return res_mean; }
            set { res_mean = value; }
        }

        public double Res_stdev
        {
            get { return res_stdev; }
            set { res_stdev = value; }
        }

        public string ErrorMessage
        {
            get { return errorMessage; }
            set { errorMessage = value; }
        }




    }
}
